Skip to main content

AwsSimpleAdapter

@h4ad/serverless-adapter > AwsSimpleAdapter

(class) AwsSimpleAdapter

The abstract adapter to use to implement other simple AWS adapters

Signature:

export declare abstract class AwsSimpleAdapter<TEvent> implements AdapterContract<TEvent, Context, AWSSimpleAdapterResponseType> 

Implements: AdapterContract <TEvent, Context, AWSSimpleAdapterResponseType >

(constructor)

Default constructor

Signature:

constructor(options: AWSSimpleAdapterOptions);

Parameters

ParameterTypeDescription
optionsAWSSimpleAdapterOptionsThe options to customize the AwsSimpleAdapter

(method) canHandle

Signature:

canHandle(_: unknown): _ is TEvent;

Parameters

ParameterTypeDescription
_unknown

Returns:

_ is TEvent

(method) getAdapterName

Signature:

getAdapterName(): string;

Returns:

string

(method) getRequest

Signature:

getRequest(event: TEvent): AdapterRequest;

Parameters

ParameterTypeDescription
eventTEvent

Returns:

AdapterRequest

(method) getResponse

Signature:

getResponse(\{ body, headers, isBase64Encoded, event, statusCode, }: GetResponseAdapterProps<TEvent>): AWSSimpleAdapterResponseType;

Parameters

ParameterTypeDescription
{ body, headers, isBase64Encoded, event, statusCode, }GetResponseAdapterProps <TEvent>

Returns:

AWSSimpleAdapterResponseType

(method) hasInvalidStatusCode

Check if the status code is invalid

Signature:

protected hasInvalidStatusCode(statusCode: number): boolean;

Parameters

ParameterTypeDescription
statusCodenumberThe status code

Returns:

boolean

(method) onErrorWhileForwarding

Signature:

onErrorWhileForwarding(\{ error, delegatedResolver, }: OnErrorProps<TEvent, AWSSimpleAdapterResponseType>): void;

Parameters

ParameterTypeDescription
{ error, delegatedResolver, }OnErrorProps <TEvent, AWSSimpleAdapterResponseType >

Returns:

void

(property) options

Signature:

protected readonly options: AWSSimpleAdapterOptions;